home *** CD-ROM | disk | FTP | other *** search
- /******************************************************/
- /* */
- /* CBrowserApp.c */
- /* */
- /* Written in Think C version 4.0.2 */
- /* Based on CStarterApp.c */
- /* */
- /* Allen Stenger January 1991 */
- /* */
- /******************************************************/
-
- #include "CBartender.h"
- #include "CBrowserApp.h"
- #include "CBrowserDoc.h"
- #include "Commands.h"
- #include "Browser.h"
-
- extern OSType gSignature;
- extern CBartender *gBartender;
-
- void CBrowserApp::IBrowserApp(void)
- {
- CApplication::IApplication(4, 20480L, 2048L);
- }
-
- void CBrowserApp::SetUpFileParameters(void)
- {
- inherited::SetUpFileParameters();
- sfNumTypes = 1;
- sfFileTypes[0] = 'TEXT';
- gSignature = '????';
- }
-
- void CBrowserApp::DoCommand(long theCommand)
- {
- short itemHit; /* which item in dialog selected */
- DialogPtr theDialogP; /* pointer to About dialog */
-
- switch (theCommand) {
- case cmdAbout:
- theDialogP = GetNewDialog(dlogAbout,
- NULL, -1L);
- ModalDialog(NULL, &itemHit);
- DisposDialog(theDialogP);
- break;
- default: inherited::DoCommand(theCommand);
- break;
- }
- }
-
- void CBrowserApp::OpenDocument(SFReply *macSFReply)
- {
- CBrowserDoc *theDocument;
-
- theDocument = new(CBrowserDoc);
- theDocument->IBrowserDoc(this, FALSE);
- /* we never print */
- theDocument->OpenFile(macSFReply);
- }
-
- void CBrowserApp::StartUpAction(short numPreloads)
- {
- FlushEvents(everyEvent, 0);
- DoCommand(cmdOpen);
- }